section .data
  num1 equ 100                   ; define constant
  num2 equ 50                    ; define constant
  msg db "Sum is correct\n"      ; initialize message

section .text
  global _start

;; Entry point
_start:
  mov rax, num1                 ; set num1's value to rax
  mov rbx, num2                 ; set num2's value to rbx
  add rax, rbx                  ; get sum of rax and rbx, and store it's value in rax
  cmp rax, 150                  ; compare rax and 150
  jne .exit                     ; to .exit label if rax is not equal to 150
  jmp .rightSum                 ; go to .rightSum label if rax and 150 are equal

;; Print message that sum is correct
.rightSum:
  mov rax, 1                    ; write system call
  mov rdi, 1                    ; first argument: file descriptor, standard output
  mov rsi, msg                  ; second argument: message address
  mov rdx, 14                   ; third argument: length of message
  syscall                       ; call write syscall

;; Exit procedure
.exit:
  mov rax, 60                   ; exit system call
  mov rdi, 0                    ; first argument: exit code
  syscall                       ; call exit syscall
